home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / comm1 / intsdkss.lha / include / netdb.h < prev    next >
C/C++ Source or Header  |  1996-04-09  |  3KB  |  101 lines

  1. /*
  2.  * Copyright (c) 1980, 1983, 1988 Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms are permitted
  6.  * provided that the above copyright notice and this paragraph are
  7.  * duplicated in all such forms and that any documentation,
  8.  * advertising materials, and other materials related to such
  9.  * distribution and use acknowledge that the software was developed
  10.  * by the University of California, Berkeley.  The name of the
  11.  * University may not be used to endorse or promote products derived
  12.  * from this software without specific prior written permission.
  13.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  14.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  15.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  16.  *
  17.  *    @(#)netdb.h    5.10 (Berkeley) 6/27/88
  18.  */
  19.  
  20. #ifndef NETDB_H
  21. #define NETDB_H
  22.  
  23. /*
  24.  * Structures returned by network
  25.  * data base library.  All addresses
  26.  * are supplied in host order, and
  27.  * returned in network order (suitable
  28.  * for use in system calls).
  29.  */
  30. struct    hostent {
  31.     char    *h_name;    /* official name of host */
  32.     char    **h_aliases;    /* alias list */
  33.     int    h_addrtype;    /* host address type */
  34.     int    h_length;    /* length of address */
  35.     char    **h_addr_list;    /* list of addresses from name server */
  36. #define    h_addr    h_addr_list[0]    /* address, for backward compatiblity */
  37. };
  38.  
  39. /*
  40.  * Assumption here is that a network number
  41.  * fits in 32 bits -- probably a poor one.
  42.  */
  43. struct    netent {
  44.     char        *n_name;    /* official name of net */
  45.     char        **n_aliases;    /* alias list */
  46.     int        n_addrtype;    /* net address type */
  47.     unsigned long    n_net;        /* network # */
  48. };
  49.  
  50. struct    servent {
  51.     char    *s_name;    /* official service name */
  52.     char    **s_aliases;    /* alias list */
  53.     int    s_port;        /* port # */
  54.     char    *s_proto;    /* protocol to use */
  55. };
  56.  
  57. struct    protoent {
  58.     char    *p_name;    /* official protocol name */
  59.     char    **p_aliases;    /* alias list */
  60.     int    p_proto;    /* protocol # */
  61. };
  62.  
  63. struct rpcent {
  64.     char    *r_name;    /* name of server for this rpc program */
  65.     char    **r_aliases;    /* alias list */
  66.     long    r_number;    /* rpc program number */
  67. };
  68.  
  69. struct rpcent *getrpcbyname(), *getrpcbynumber(), *getrpcent();
  70.  
  71. /*
  72. struct hostent    *gethostbyname(), *gethostbyaddr(), *gethostent();
  73. struct netent    *getnetbyname(), *getnetbyaddr(), *getnetent();
  74. struct servent    *getservbyname(), *getservbyport(), *getservent();
  75. struct protoent    *getprotobyname(), *getprotobynumber(), *getprotoent();
  76. */
  77.  
  78.  
  79. /*
  80.  * Error return codes from gethostbyname() and gethostbyaddr()
  81.  * (left in extern int h_errno).
  82.  */
  83.  
  84. #define    HOST_NOT_FOUND    1 /* Authoritative Answer Host not found */
  85. #define    TRY_AGAIN    2 /* Non-Authoritive Host not found, or SERVERFAIL */
  86. #define    NO_RECOVERY    3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
  87. #define    NO_DATA        4 /* Valid name, no data record of requested type */
  88. #define    NO_ADDRESS    NO_DATA        /* no address, look for MX record */
  89.  
  90. #define HOSTFILE    "inet:db/hosts"
  91. #define PROTOFILE    "inet:db/protocols"
  92. #define SERVFILE    "inet:db/services"
  93. #define NETFILE        "inet:db/networks"
  94. #define RPCFILE        "inet:db/rpc"
  95. #define INETDFILE    "inet:db/inetd.conf"
  96. #define WTMPFILE    "inet:log/wtmp"
  97. #define SYSLOGCONF    "inet:db/syslog.conf"
  98. #define HOSTSEQUIV    "inet:db/hosts.equiv"
  99.  
  100. #endif /* NETDB_H */
  101.